<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserCarsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_cars', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->default('0')->comment('用户ID');
            $table->integer('brand_id')->default('0')->comment('品牌ID');
            $table->string('brand_name')->nullable()->comment('品牌名称');
            $table->string('type')->default('')->comment('车辆类型');
            $table->string('plate_number')->default('')->comment('车牌号');
            $table->string('color')->default('')->comment('车身颜色');
            $table->string('name')->default('')->comment('联系人');
            $table->string('phone')->default('')->comment('联系方式');
            $table->tinyInteger('is_default')->default('0')->comment('是否默认:0=否,1=是');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_cars');
    }
}
